/**
 * 2
 *  
 * @Author : roryrywang
 * @DateTime : 24-8-25 下午6:51
 */

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int a, b;
        char op;
        cin >> a >> b >> op;
        if (op == '+' || op == '*') {
            puts("=");
            continue;
        }
        int diff = a - b;
        if (op == '^') {
            if ((a == 2 && b == 3) || (a == 3 && b == 2) || a == 1 || b == 1) {
            } else if ((a == 4 && b == 2) || (a == 2 && b == 4)) {
                diff = 0;
            } else {
                diff = -diff;
            }
        }
        if (diff < 0) {
            cout << "<" << endl;
        } else if (diff == 0) {
            cout << "=" << endl;
        } else {
            cout << ">" << endl;
        }
    }
    return 0;
}